﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPagePrivate.master" AutoEventWireup="true" CodeFile="ProjectList.aspx.cs" Inherits="Pages_Admin_ProjectList" %>
<%@ Register Src="~/UserControls/DataTableList.ascx" TagName="DataTableList" TagPrefix="UC" %>
<%@ Register Src="~/UserControls/Pager.ascx" TagName="Pager" TagPrefix="UC" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageHeader" Runat="Server">
    <script language="javascript" type="text/javascript">
        function ValidateListSelection(sender, args) {
            if($("#<%=ucProjectList.ListTableClientID %> input[type='checkbox']:checked").length > 0)
                args.IsValid = true;
            else
                args.IsValid = false;
        }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageBody" Runat="Server">
     <h4 id="h4Heading" runat="server">Project List</h4>
    <div id="divMessage" runat="server" visible="false" enableviewstate="false"></div>

    <div class="GroupBox">
        <div class="GroupHeaderOverlay">Search Options</div>
        <table cellpadding="3" cellspacing="0" style="width:90%;">
            <tr>
                <td style="width:15%;">Customer</td>
                <td>
                    <asp:DropDownList ID="ddlCustomer" runat="server" style="width:250px"></asp:DropDownList>
                </td>                
                <td style="padding-left:15px;">
                    <asp:CheckBox ID="chkIsApproved" Text="Projects Waiting for Approval" runat="server" />
                </td>
            </tr>
            <tr>
                <td>Property Type</td>
                <td colspan="2">
                    <asp:DropDownList ID="ddlPropertyType" runat="server" style="width:250px"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                </td>
            </tr>         
        </table>
    </div>
    <div class="ListingContainer">
        <div>
            <asp:CustomValidator ID="cvProjectListSelection" runat="server"
                ClientValidationFunction="ValidateListSelection"
                ValidateEmptyText="true"
                Display="Dynamic"
                ErrorMessage="Please select few project(s)."
                ValidationGroup="MakeFeatured">
            </asp:CustomValidator>
        </div>
        <UC:DataTableList id="ucProjectList" runat="server"
            SelectionCheckBoxField="ID"
            ExcludeVisibleFields="ID, TotalRecord, RowNumber, Description, ShowPricingInfo" 
            LinkFields="ID" CheckForDeletePermission="False">
        </UC:DataTableList>
        
        <div style="margin-top:10px;">
            <UC:Pager ID="ucProjectListPager" runat="server" OnPageIndexChanged="ucProjectListPager_PageIndexChanged" />
        </div>
    </div>

    <div class="ButtonContainer">
        <asp:Button ID="btnApprove" runat="server" ValidationGroup="MakeFeatured" Text="Approve" OnClick="btnApprove_Click" Visible="false" />
        <asp:Button ID="btnMakeHot" runat="server" ValidationGroup="MakeFeatured" Text="Make Featured" CssClass="ButtonInActive" OnClick="btnMakeHot_Click" Visible="false" />
        <asp:Button ID="btnRemoveHot" runat="server" ValidationGroup="MakeFeatured" Text="Remove Featured" CssClass="ButtonInActive" OnClick="btnRemoveHot_Click" Visible="false" />        
    </div>
</asp:Content>

